<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>yqTextCSV</title>
    <uieip type="file" value="inc" src="/yqwin/easyui/include.txt" cache="true" minute="1440"></uieip>
    <uieip type="file" value="css" src="/yqwin/css/yqwin.min" cache="false"></uieip>
    <uieip type="file" value="js" src="/yqwin/data/yqwin.min" cache="false"></uieip>
</head>

<body>
    <h1>yqTextCSV</h1>
    <input id="tb" type="text" style="width:280px;">
    <p></p>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:setValue()">setValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:clearValue()">clear</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:getValue()">getValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(true)">isEdit==true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(false)">isEdit==false</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:showEdit(true)">showEdit==true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:showEdit(false)">showEdit==false</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:destroy()">destroy</a>
    <script>
        $(function () {
            $("#tb").yqTextCSV({
                ui_type: 2,  //输入值类型 2:文本 4:日期 9:numberBox 10:numberSpinner,11timeSpinner,12:dateTimeSpinner
                ui_mask: {}, //掩码
                separator: ",", //分隔符
                value: "a1,a2,a3", //默认值
                isEdit: true,
                isAdd: true,
                isDel: true,
                isMove: true,
                editModeW: 500, //模态编辑器宽度 格式为 800（数字）
                editModeH: 300, //模态编辑器高度 格式为 600（数字）
                showEdit: true, //是否显示编辑按钮
                beforeBindingTitle: function (titles, callback) {
                    callback(titles);
                }, //标题绑定前
                afterBindingTitle: function () { },   //标题绑定后

                beforeEditShow: function (edit_type, options, callback) {
                    callback(true, edit_type, options);
                }, //弹出框显示前

                beforeAdd: function (rows, row, callback) {
                    callback(row);
                },
                afterChange: function (value) {
                },
            });
        });

        function setValue() {
            $("#tb").yqTextCSV("setValue", "AA1,BB1,CC1");
        }

        function clearValue() {
            $("#tb").yqTextCSV("clear");
        }

        function getValue() {
            var val = $("#tb").yqTextCSV("getValue");
            console.log("getValue", val);
        }

        function isEdit(tf) {
            $("#tb").yqTextCSV("isEdit", tf);
        }

        function showEdit(tf) {
            $("#tb").yqTextCSV("showEdit", tf);
        }

        function destroy() {
            $("#tb").yqTextCSV("destroy");
        }

    </script>
</body>

</html>